import {
	ref
} from "vue"

/**
 * @@param {callback} 点击时除了切换index还要做的事 
 */
export const useTab = (callback = () => {}) => {
	const currentIndex = ref(0)

	const changeIndex = (index) => {
		currentIndex.value = index
		callback()
	}

	return {
		currentIndex,
		changeIndex
	}
}